import request from "@/utils/request";
import {getData, postData} from "@/utils/Util";

class Api {
    /*
     *登录：name, password
     */
    login(data) {
        /*        return request({
                  url: "/user/login",
                  method: "post",
                   data,
                });*/
        return postData("/user/login", data, true);
    }
    
    getInfo(token) {
        /*return request({
            url: "/user/info",
            method: "get",
            params: { token },
            headers: { "Cache-Control": "no-store" }
        });*/
        return getData("/user/info");
    }
    
    changeInfo(data) {
        return request({
            url: "/user/changeInfo",
            method: "post",
            data
        });
    }
}

export const api = new Api();
